//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
      // 组件所需的参数
      navbarData: {
        showCapsule: 0, //是否显示左上角图标   1表示显示    0表示不显示
        title: '地材通', //导航栏 中间的标题
      },
      bgHeight:app.globalData.status+app.globalData.navHeight+55,
      //height: app.globalData.navHeight,  //页面内容距最顶部的距离
      swiperItems:[{
        url:'../../images/banner1.jpg'
      },{
        url:'../../images/banner2.jpg'
      }],
      swiperConfig: {
        autoplay: true,
        interval: 3000,
        circular: true
      },
      headTop:app.globalData.status+app.globalData.navHeight+10
  },
  
  onLoad: function () {
    
  },
  //快速导航跳转
  quickList(e){
    console.log('e',e);
    let link=e.currentTarget.dataset.link;
    if(link==1){
      wx.navigateTo({
        url: '../buyerClub/buyerClub'
      })
    }else if(link==2){
      wx.navigateTo({
        url: '../productRecommend/productRecommend'
      })
    }else{
      wx.navigateTo({
        url: '../userInfo/userInfo'
      })
    }
  },
  //九宫格
  goCate(e){
    let index=e.currentTarget.dataset.index;
    console.log('index',index);
    if(index==1){
      wx.navigateTo({
        url: '../caiLiaoKu/caiLiaoKu',
      })
    }else if(index==2){
      wx.switchTab({
        url: '../fanju/fanju',
      })
    }else if(index==3){
      wx.navigateTo({
        url: '../anli/anli',
      })
    }else if(index==4){
      wx.navigateTo({
        url: '../VR/VR',
      })
    }else if(index==5){
      wx.navigateTo({
        url: '../mudiban/mudiban',
      })
    }else if(index==6){
      console.log('VR')
    }
  },
  //优商推荐
  moSupplier(){
    wx.navigateTo({
      url: '../supplierRecommend/supplierRecommend',
    })
  },
  //DEMO优选
  youXuan(){
    wx.navigateTo({
      url: '../youXuan/youXuan',
    })
  },
  //材料库
  caiLiaoKu(){
    wx.navigateTo({
      url: '../caiLiaoKu/caiLiaoKu',
    })
  },
  //搜索
  search(){
    wx.navigateTo({
      url: '../search/search'
    })
  }
})
